package com.lemon.components.wechart;

import com.lemon.components.wechart.impl.UploadServiceImpl;
import com.lemon.components.wechart.order.media.GetMediaOrder;
import com.lemon.components.wechart.result.media.GetMediaResourceResult;

public class Main {

	public static void main(String[] args) {
		
		String appid="wxd7c999686574d0b9";
		String appsecret="5e7fecd478c066b286c803d91ac23b8e";
		String accessToken = "My03zCL9IzAkeHlXDM7J7xrW0-p27efGG7K5LAcQu4YOMQ2PqqZUTow53uWvHtF9xJcauepjR3LJIl_Ou0RZQ_g2l2d53-S_zbTXlNlCLBBh9D4d70o5O-NU0qS2q9hrZURjAGAPKH";
		String mediaId = "z_vFa4W56pWIgffr72EuHvzIp0RBOm0mY6TOnt5k_sJiANFKtBfK_KIgoY6mSkwD";
		
		
		/*UserInfoOrder userInfoOrder = new UserInfoOrder();
		userInfoOrder.setAccessToken(accessToken);
		userInfoOrder.setOpenid("o9sJHt1ZiuxwKmtYUEwQMTz0PSzg");
		UserInfoResult userInfoResult = userService.getUserInfo(userInfoOrder);
		System.out.println("获得用户信息："+userInfoResult.toString());*/
		
		/*SupporterService supporterService = new SupporterServiceImpl();
		
		AddSupporterOrder addSupporterOrder = new AddSupporterOrder();
		addSupporterOrder.setAccessToken(accessToken);
		addSupporterOrder.setKf_account("jlcon1");
		addSupporterOrder.setNickname("江路店小二");
		
		addSupporterOrder.setPassword(MD5Util.getMD5_32("jlcon123456"));
		
		supporterService.addSupporter(addSupporterOrder);*/
		
		UploadService uploadService = new UploadServiceImpl();
		/*UploadMediaOrder uploadOrder = new UploadMediaOrder();
		uploadOrder.setAccessToken(accessToken);
		uploadOrder.setMedia("test.png");
		uploadOrder.setType(MediaTypeEnum.image);
		try {
			uploadOrder.setInputStream(new FileInputStream("D:/abc.png"));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
		uploadService.upload(uploadOrder);*/
		
		GetMediaOrder getMediaOrder = new GetMediaOrder();
		getMediaOrder.setAccessToken(accessToken);
		getMediaOrder.setMediaId(mediaId);
		GetMediaResourceResult getMediaResourceResult = uploadService.getMediaResource(getMediaOrder);
		System.out.println(getMediaResourceResult.getUrl());
	}

}
